<!DOCTYPE html><html><head>
  <meta charset="utf-8">
  <base data-ice="baseUrl" href="/v5/../../">
  <title data-ice="title">Model | Sequelize</title>
  <link type="text/css" rel="stylesheet" href="/v5/css/style.css">
  <link type="text/css" rel="stylesheet" href="/v5/css/prettify-tomorrow.css">
  <script src="/v5/script/prettify/prettify.js"></script>
  <script src="/v5/script/manual.js"></script>
<link rel="stylesheet" href="/v5/./inject/css/0-style.css"><link rel="stylesheet" href="/v5/./inject/css/0-theme.css"><meta name="description" content="An easy-to-use multi SQL dialect ORM for Node.js"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="Sequelize"><meta property="twitter:description" content="An easy-to-use multi SQL dialect ORM for Node.js"><meta name="robots" content="noindex"></head>
<body class="layout-container" data-ice="rootContainer">

<header>
  <a href="/v5/./" style="display: flex; align-items: center;"><img src="/v5/./image/brand_logo.png" style="width:34px;"></a>
  
  <a href="/v5/identifiers.html" class="api-reference-link">API Reference</a>
  <a href="/v5/source.html">Source</a>
  
  <div class="search-box">
  <span>
    <img src="/v5/./image/search.png">
    <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
  </span>
    <ul class="search-result"></ul>
  </div>
<a style="" href="https://github.com/sequelize/sequelize"><img width="30px" src="/v5/./image/github.png" style="width: 30px;"></a>
      <a href="https://sequelize.org/slack">
        <img src="/v5/manual/asset/slack.svg" style="width: 60px; margin-left: -15px;">
      </a>
    </header>

<nav class="navigation" data-ice="nav"><div>
  <ul>
    
  


































<li data-ice="doc" style="margin-top: 15px;"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/query-interface.js~QueryInterface.html">QueryInterface</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/sequelize.js~Sequelize.html">Sequelize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="/v5/variable/index.html#static-variable-DataTypes">DataTypes</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="/v5/variable/index.html#static-variable-Deferrable">Deferrable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="/v5/variable/index.html#static-variable-IndexHints">IndexHints</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="/v5/variable/index.html#static-variable-Op">Op</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="/v5/variable/index.html#static-variable-QueryTypes">QueryTypes</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="/v5/variable/index.html#static-variable-TableHints">TableHints</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="/v5/identifiers.html#associations">associations</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/associations/base.js~Association.html">Association</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/associations/belongs-to-many.js~BelongsToMany.html">BelongsToMany</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/associations/belongs-to.js~BelongsTo.html">BelongsTo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/associations/has-many.js~HasMany.html">HasMany</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/associations/has-one.js~HasOne.html">HasOne</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="/v5/identifiers.html#dialects-sqlite">dialects/sqlite</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="/v5/function/index.html#static-function-describeTable">describeTable</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="/v5/identifiers.html#errors">errors</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/association-error.js~AssociationError.html">AssociationError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/base-error.js~BaseError.html">BaseError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/bulk-record-error.js~BulkRecordError.html">BulkRecordError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/connection-error.js~ConnectionError.html">ConnectionError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/database-error.js~DatabaseError.html">DatabaseError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/eager-loading-error.js~EagerLoadingError.html">EagerLoadingError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/empty-result-error.js~EmptyResultError.html">EmptyResultError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/instance-error.js~InstanceError.html">InstanceError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/optimistic-lock-error.js~OptimisticLockError.html">OptimisticLockError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/query-error.js~QueryError.html">QueryError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/sequelize-scope-error.js~SequelizeScopeError.html">SequelizeScopeError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/validation-error.js~ValidationError.html">ValidationError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/validation-error.js~ValidationErrorItem.html">ValidationErrorItem</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="/v5/identifiers.html#errors-connection">errors/connection</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/connection/access-denied-error.js~AccessDeniedError.html">AccessDeniedError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/connection/connection-acquire-timeout-error.js~ConnectionAcquireTimeoutError.html">ConnectionAcquireTimeoutError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/connection/connection-refused-error.js~ConnectionRefusedError.html">ConnectionRefusedError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/connection/connection-timed-out-error.js~ConnectionTimedOutError.html">ConnectionTimedOutError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/connection/host-not-found-error.js~HostNotFoundError.html">HostNotFoundError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/connection/host-not-reachable-error.js~HostNotReachableError.html">HostNotReachableError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/connection/invalid-connection-error.js~InvalidConnectionError.html">InvalidConnectionError</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="/v5/identifiers.html#errors-database">errors/database</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/database/exclusion-constraint-error.js~ExclusionConstraintError.html">ExclusionConstraintError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/database/foreign-key-constraint-error.js~ForeignKeyConstraintError.html">ForeignKeyConstraintError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/database/timeout-error.js~TimeoutError.html">TimeoutError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/database/unknown-constraint-error.js~UnknownConstraintError.html">UnknownConstraintError</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="/v5/identifiers.html#errors-validation">errors/validation</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/errors/validation/unique-constraint-error.js~UniqueConstraintError.html">UniqueConstraintError</a></span></span></li>
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="/v5/variable/index.html#static-variable-DataTypes">datatypes</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~ARRAY.html">ARRAY</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~VIRTUAL.html">VIRTUAL</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~UUIDV4.html">UUIDV4</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~UUIDV1.html">UUIDV1</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~UUID.html">UUID</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~TINYINT.html">TINYINT</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~TIME.html">TIME</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~TEXT.html">TEXT</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~STRING.html">STRING</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~SMALLINT.html">SMALLINT</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~REAL.html">REAL</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~RANGE.html">RANGE</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~NUMBER.html">NUMBER</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~NOW.html">NOW</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~MEDIUMINT.html">MEDIUMINT</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~MACADDR.html">MACADDR</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~JSONTYPE.html">JSONTYPE</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~JSONB.html">JSONB</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~INTEGER.html">INTEGER</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~INET.html">INET</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~HSTORE.html">HSTORE</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~GEOMETRY.html">GEOMETRY</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~GEOGRAPHY.html">GEOGRAPHY</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~FLOAT.html">FLOAT</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~ENUM.html">ENUM</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~DOUBLE.html">DOUBLE</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~DECIMAL.html">DECIMAL</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~DATEONLY.html">DATEONLY</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~DATE.html">DATE</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~CITEXT.html">CITEXT</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~CIDR.html">CIDR</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~CHAR.html">CHAR</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~BOOLEAN.html">BOOLEAN</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~BLOB.html">BLOB</a></span></span></li><li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="/v5/class/lib/data-types.js~BIGINT.html">BIGINT</a></span></span></li></ul>
</div>
</nav>

<div class="content" data-ice="content"><div class="header-notice">
  <div data-ice="importPath" class="import-path"><pre class="prettyprint"><code data-ice="importPathCode"></code></pre></div>
  <span data-ice="access">public</span>
  <span data-ice="kind">class</span>
  
  
  
  <span data-ice="source">| <span><a href="/v5/file/lib/model.js.html#lineNumber54">source</a></span></span>
</div>

<div class="self-detail detail">
  <h1 data-ice="name">Model</h1>

  

  
  
  
  
  
  
  
  
  

  
  
  <div class="description" data-ice="description"><p>A Model represents a table in the database. Instances of this class represent a database row.</p>
<p>Model instances operate with the concept of a <code>dataValues</code> property, which stores the actual values represented by the instance.
By default, the values from dataValues can also be accessed directly from the Instance, that is:</p>
<pre><code class="lang-js"><code class="source-code prettyprint">instance.field
// is the same as
instance.get('field')
// is the same as
instance.getDataValue('field')</code>
</code></pre>
<p>However, if getters and/or setters are defined for <code>field</code> they will be invoked, instead of returning the value from <code>dataValues</code>.
Accessing properties directly or using <code>get</code> is preferred for regular use, <code>getDataValue</code> should only be used for custom getters.</p>
</div>
  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/sequelize.js~Sequelize.html#instance-method-define">Sequelize#define</a></span> for more information about getters and setters</span></li></ul></div>

  

  

  
</div>


<div data-ice="staticMethodSummary"><h2>Static Method Summary</h2><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Static Public Methods</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-addScope">addScope</a></span></span><span class="code" data-ice="signature">(name: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, scope: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>)</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Add a new scope to the model.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-aggregate">aggregate</a></span></span><span class="code" data-ice="signature">(attribute: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, aggregateFunction: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/variable/index.html#static-variable-DataTypes">DataTypes</a></span>|<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Run an aggregation method on the specified field</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-belongsTo">belongsTo</a></span></span><span class="code" data-ice="signature">(target: <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/associations/belongs-to.js~BelongsTo.html">BelongsTo</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Creates an association between this (the source) and the provided target.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-belongsToMany">belongsToMany</a></span></span><span class="code" data-ice="signature">(target: <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/associations/belongs-to-many.js~BelongsToMany.html">BelongsToMany</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Create an N:M association with a join table.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-build">build</a></span></span><span class="code" data-ice="signature">(values: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Builds a new model instance.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-bulkCreate">bulkCreate</a></span></span><span class="code" data-ice="signature">(records: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Create and insert multiple instances in bulk.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-count">count</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Count the number of records matching the provided where clause.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-create">create</a></span></span><span class="code" data-ice="signature">(values: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Builds a new model instance and calls save on it.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-decrement">decrement</a></span></span><span class="code" data-ice="signature">(fields: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span><span>[]</span></span>, ?<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Decrement the value of one or more columns.</p>
</div>
      </div>
    </td>
    <td>
      
      <span class="since" data-ice="since">since 4.36.0</span>
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-describe">describe</a></span></span><span class="code" data-ice="signature">(schema: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Run a describe query on the table.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-destroy">destroy</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Delete multiple instances, or set their deletedAt timestamp to the current time if <code>paranoid</code> is enabled.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-drop">drop</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Drop the table represented by this Model</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-findAll">findAll</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Search for multiple instances.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-findAndCountAll">findAndCountAll</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;{count: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, rows: <span><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span><span>[]</span></span>}&gt;<!--{count:--></span>
        </span></p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Find all the rows matching your query, within a specified offset / limit, and get the total number of rows matching your query.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-findByPk">findByPk</a></span></span><span class="code" data-ice="signature">(param: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span>Buffer</span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Search for a single instance by its primary key._</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-findCreateFind">findCreateFind</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>A more performant findOrCreate that will not work under a transaction (at least not in postgres)
Will execute a find call, if empty then attempt to create, if unique constraint then attempt to find again</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-findOne">findOne</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Search for a single instance.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-findOrBuild">findOrBuild</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Find a row that matches the query, or build (but don't save) the row if none is found.
The successful result of the promise will be (instance, built)</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-findOrCreate">findOrCreate</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Find a row that matches the query, or build and save the row if none is found
The successful result of the promise will be (instance, created)</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-getTableName">getTableName</a></span></span><span class="code" data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Get the table name of the model, taking schema into account.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-hasMany">hasMany</a></span></span><span class="code" data-ice="signature">(target: <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/associations/has-many.js~HasMany.html">HasMany</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Creates a 1:m association between this (the source) and the provided target.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-hasOne">hasOne</a></span></span><span class="code" data-ice="signature">(target: <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/associations/has-one.js~HasOne.html">HasOne</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Creates an association between this (the source) and the provided target.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-increment">increment</a></span></span><span class="code" data-ice="signature">(fields: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span><span>[]</span></span>, ?<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Increment the value of one or more columns.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-init">init</a></span></span><span class="code" data-ice="signature">(attributes: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Initialize a model, representing a table in the DB, with attributes and options.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-max">max</a></span></span><span class="code" data-ice="signature">(field: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span>*</span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Find the maximum value of field</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-min">min</a></span></span><span class="code" data-ice="signature">(field: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span>*</span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Find the minimum value of field</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-removeAttribute">removeAttribute</a></span></span><span class="code" data-ice="signature">(attribute: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>)</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Remove attribute from model definition</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-restore">restore</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Restore multiple instances if <code>paranoid</code> is enabled.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-schema">schema</a></span></span><span class="code" data-ice="signature">(schema: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Apply a schema to this model.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-scope">scope</a></span></span><span class="code" data-ice="signature">(option: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Apply a scope created in <code>define</code> to the model.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-sum">sum</a></span></span><span class="code" data-ice="signature">(field: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Find the sum of field</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-sync">sync</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Sync this Model to the DB, that is create the table.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-truncate">truncate</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Truncate all instances of the model.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-unscoped">unscoped</a></span></span><span class="code" data-ice="signature">(): <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Get un-scoped model</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-update">update</a></span></span><span class="code" data-ice="signature">(values: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>, <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Update multiple instances that match the where options.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      <span data-ice="static">static</span>
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#static-method-upsert">upsert</a></span></span><span class="code" data-ice="signature">(values: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Insert or update a single row.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>
<div data-ice="constructorSummary"><h2>Constructor Summary</h2><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Public Constructor</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-constructor-constructor">constructor</a></span></span><span class="code" data-ice="signature">(values: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>)</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Builds a new model instance.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>
<div data-ice="memberSummary"><h2>Member Summary</h2><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Public Members</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-member-isNewRecord">isNewRecord</a></span></span><span class="code" data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>: <span>*</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Returns true if this instance has not yet been persisted to the database</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      <span class="kind" data-ice="kind">get</span>
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-get-sequelize">sequelize</a></span></span><span class="code" data-ice="signature">: <span><a href="/v5/class/lib/sequelize.js~Sequelize.html">Sequelize</a></span>: <span>*</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>A reference to the sequelize instance</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>
<div data-ice="methodSummary"><h2>Method Summary</h2><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Public Methods</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-changed">changed</a></span></span><span class="code" data-ice="signature">(key: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, value: <span>any</span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>If changed is called with a string it will return a boolean indicating whether the value of that key in <code>dataValues</code> is different from the value in <code>_previousDataValues</code>.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-decrement">decrement</a></span></span><span class="code" data-ice="signature">(fields: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Decrement the value of one or more columns.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-destroy">destroy</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Destroy the row corresponding to this instance.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-equals">equals</a></span></span><span class="code" data-ice="signature">(other: <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Check whether this and <code>other</code> Instance refer to the same row</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-equalsOneOf">equalsOneOf</a></span></span><span class="code" data-ice="signature">(others: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Check if this is equal to one of <code>others</code> by calling equals</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-get">get</a></span></span><span class="code" data-ice="signature">(key: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span> | <span>any</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>If no key is given, returns all values of the instance, also invoking virtual getters.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-getDataValue">getDataValue</a></span></span><span class="code" data-ice="signature">(key: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>any</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Get the value of the underlying data value</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-increment">increment</a></span></span><span class="code" data-ice="signature">(fields: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Increment the value of one or more columns.</p>
</div>
      </div>
    </td>
    <td>
      
      <span class="since" data-ice="since">since 4.0.0</span>
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-isSoftDeleted">isSoftDeleted</a></span></span><span class="code" data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Helper method to determine if a instance is "soft deleted".</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-previous">previous</a></span></span><span class="code" data-ice="signature">(key: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>any</span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span>any</span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Returns the previous value for key from <code>_previousDataValues</code>.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-reload">reload</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Refresh the current instance in-place, i.e.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-restore">restore</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Restore the row corresponding to this instance.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-save">save</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Validate this instance, and if the validation passes, persist it to the database.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-set">set</a></span></span><span class="code" data-ice="signature">(key: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, value: <span>any</span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Set is used to update values on the instance (the sequelize representation of the instance that is, remember that nothing will be persisted before you actually call <code>save</code>).</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-setDataValue">setDataValue</a></span></span><span class="code" data-ice="signature">(key: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, value: <span>any</span>)</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Update the underlying data value</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-toJSON">toJSON</a></span></span><span class="code" data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Convert the instance to a JSON representation.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-update">update</a></span></span><span class="code" data-ice="signature">(values: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>This is the same as calling <code>set</code> and then calling <code>save</code> but it only saves the
exact values passed to it, making it more atomic and safer.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-validate">validate</a></span></span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Validate the attributes of this instance according to validation rules set in the model definition.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
          
          
          
          <span class="code" data-ice="name"><span><a href="/v5/class/lib/model.js~Model.html#instance-method-where">where</a></span></span><span class="code" data-ice="signature">(checkVersion: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Get an object representing the query for this instance, use with <code>options.where</code></p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>




<div data-ice="staticMethodDetails"><h2 data-ice="title">Static Public Methods</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-addScope">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">addScope</span><span class="code" data-ice="signature">(name: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, scope: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>)</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber1465">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Add a new scope to the model. This is especially useful for adding scopes with includes, when the model you want to include is not available at the time this model is defined.</p>
<p>By default this will throw an error if a scope with that name already exists. Pass <code>override: true</code> in the options object to silence this error.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">name</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The name of the scope. Use <code>defaultScope</code> to override the default scope</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">scope</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>scope or options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>scope options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.override</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>override old scope if already defined</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-aggregate">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">aggregate</span><span class="code" data-ice="signature">(attribute: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, aggregateFunction: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/variable/index.html#static-variable-DataTypes">DataTypes</a></span>|<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber1947">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Run an aggregation method on the specified field</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">attribute</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The attribute to aggregate over. Can be a field name or *</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">aggregateFunction</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The function to use for aggregation, e.g. sum, max etc.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Query options. See sequelize.query for full options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.where</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>A hash of search attributes.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.benchmark</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Pass query execution time in milliseconds as second argument to logging function (options.logging).</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.dataType</td>
      <td data-ice="type" class="code"><span><a href="/v5/variable/index.html#static-variable-DataTypes">DataTypes</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The type of the result. If <code>field</code> is a field in this Model, the default will be the type of that field, otherwise defaults to float.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.distinct</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Applies DISTINCT to the field being aggregated over</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.plain</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>When <code>true</code>, the first returned value of <code>aggregateFunction</code> is cast to <code>dataType</code> and returned. If additional attributes are specified, along with <code>group</code> clauses, set <code>plain</code> to <code>false</code> to return all values of all returned rows.  Defaults to <code>true</code></p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/variable/index.html#static-variable-DataTypes">DataTypes</a></span>|<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>&gt;</td>
          <td class="return-desc" data-ice="returnDescription"><p>Returns the aggregate result cast to <code>options.dataType</code>, unless <code>options.plain</code> is false, in which case the complete data result is returned.</p>
</td>
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-belongsTo">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">belongsTo</span><span class="code" data-ice="signature">(target: <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/associations/belongs-to.js~BelongsTo.html">BelongsTo</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4515">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Creates an association between this (the source) and the provided target. The foreign key is added on the source.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">target</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The target model</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>belongsTo association options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.hooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Set to true to run before-/afterDestroy hooks when an associated model is deleted because of a cascade. For example if <code>User.hasOne(Profile, {onDelete: 'cascade', hooks:true})</code>, the before-/afterDestroy hooks for profile will be called when a user is deleted. Otherwise the profile will be deleted without invoking any hooks</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.as</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The alias of this model, in singular form. See also the <code>name</code> option passed to <code>sequelize.define</code>. If you create multiple associations between the same tables, you should provide an alias to be able to distinguish between them. If you provide an alias when creating the association, you should provide the same alias when eager loading and when getting associated models. Defaults to the singularized name of target</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.foreignKey</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The name of the foreign key attribute in the source table or an object representing the type definition for the foreign column (see <code>Sequelize.define</code> for syntax). When using an object, you can add a <code>name</code> property to set the name of the column. Defaults to the name of target + primary key of target</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.targetKey</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The name of the attribute to use as the key for the association in the target table. Defaults to the primary key of the target table</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.onDelete</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: 'SET&nbsp;NULL|NO&nbsp;ACTION'</li></ul></td>
      <td data-ice="description"><p>SET NULL if foreignKey allows nulls, NO ACTION if otherwise</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.onUpdate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: 'CASCADE'</li></ul></td>
      <td data-ice="description"><p>Sets 'ON UPDATE'</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.constraints</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Should on update and on delete constraints be enabled on the foreign key.</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="/v5/class/lib/associations/belongs-to.js~BelongsTo.html">BelongsTo</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">Profile.belongsTo(User) // This will add userId to the profile table</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-belongsToMany">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">belongsToMany</span><span class="code" data-ice="signature">(target: <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/associations/belongs-to-many.js~BelongsToMany.html">BelongsToMany</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4474">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Create an N:M association with a join table. Defining <code>through</code> is required.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">target</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Target model</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>belongsToMany association options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.hooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Set to true to run before-/afterDestroy hooks when an associated model is deleted because of a cascade. For example if <code>User.hasOne(Profile, {onDelete: 'cascade', hooks:true})</code>, the before-/afterDestroy hooks for profile will be called when a user is deleted. Otherwise the profile will be deleted without invoking any hooks</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.through</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The name of the table that is used to join source and target in n:m associations. Can also be a sequelize model if you want to define the junction table yourself and add extra attributes to it.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.through.model</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The model used to join both sides of the N:M association.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.through.scope</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>A key/value set that will be used for association create and find defaults on the through model. (Remember to add the attributes to the through model)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.through.unique</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>If true a unique key will be generated from the foreign keys used (might want to turn this off and create specific unique keys when using scopes)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.as</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The alias of this association. If you provide a string, it should be plural, and will be singularized using node.inflection. If you want to control the singular version yourself, provide an object with <code>plural</code> and <code>singular</code> keys. See also the <code>name</code> option passed to <code>sequelize.define</code>. If you create multiple associations between the same tables, you should provide an alias to be able to distinguish between them. If you provide an alias when creating the association, you should provide the same alias when eager loading and when getting associated models. Defaults to the pluralized name of target</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.foreignKey</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The name of the foreign key in the join table (representing the source model) or an object representing the type definition for the foreign column (see <code>Sequelize.define</code> for syntax). When using an object, you can add a <code>name</code> property to set the name of the column. Defaults to the name of source + primary key of source</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.otherKey</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The name of the foreign key in the join table (representing the target model) or an object representing the type definition for the other column (see <code>Sequelize.define</code> for syntax). When using an object, you can add a <code>name</code> property to set the name of the column. Defaults to the name of target + primary key of target</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.scope</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>A key/value set that will be used for association create and find defaults on the target. (sqlite not supported for N:M)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.timestamps</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: sequelize.options.timestamps</li></ul></td>
      <td data-ice="description"><p>Should the join model have timestamps</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.onDelete</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: 'SET&nbsp;NULL|CASCADE'</li></ul></td>
      <td data-ice="description"><p>Cascade if this is a n:m, and set null if it is a 1:m</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.onUpdate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: 'CASCADE'</li></ul></td>
      <td data-ice="description"><p>Sets <code>ON UPDATE</code></p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.constraints</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Should on update and on delete constraints be enabled on the foreign key.</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="/v5/class/lib/associations/belongs-to-many.js~BelongsToMany.html">BelongsToMany</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">// Automagically generated join model
User.belongsToMany(Project, { through: 'UserProjects' })
Project.belongsToMany(User, { through: 'UserProjects' })

// Join model with additional attributes
const UserProjects = sequelize.define('UserProjects', {
  started: Sequelize.BOOLEAN
})
User.belongsToMany(Project, { through: UserProjects })
Project.belongsToMany(User, { through: UserProjects })</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-build">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">build</span><span class="code" data-ice="signature">(values: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2166">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Builds a new model instance.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">values</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>An object of key value pairs or an array of such. If an array, the function will return an array of instances.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Instance build options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.raw</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If set to true, values will ignore field and virtual setters.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.isNewRecord</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Is this new record</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.include</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>an array of include options - Used to build prefetched/included model instances. See <code>set</code></p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-bulkCreate">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">bulkCreate</span><span class="code" data-ice="signature">(records: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2537">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Create and insert multiple instances in bulk.</p>
<p>The success handler is passed an array of instances, but please notice that these may not completely represent the state of the rows in the DB. This is because MySQL
and SQLite do not make it easy to obtain back automatically generated IDs and other default values in a way that can be mapped to multiple records.
To obtain Instances for the newly created values, you will need to query for them again.</p>
<p>If validation fails, the promise is rejected with an array-like <a href="http://bluebirdjs.com/docs/api/aggregateerror.html">AggregateError</a></p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">records</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>List of objects (key/value pairs) to create instances from</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Bulk create options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.fields</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Fields to insert (defaults to all fields)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.validate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Should each row be subject to validation before it is inserted. The whole insert will fail if one row fails validation</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.hooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Run before / after bulk create hooks?</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.individualHooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Run before / after create hooks for each individual Instance? BulkCreate hooks will still be run if options.hooks is true.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.ignoreDuplicates</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Ignore duplicate values for primary keys? (not supported by MSSQL or Postgres &lt; 9.5)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.updateOnDuplicate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Fields to update if row key already exists (on duplicate key update)? (only supported by MySQL, MariaDB, SQLite &gt;= 3.24.0 &amp; Postgres &gt;= 9.5). By default, all fields are updated.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.benchmark</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Pass query execution time in milliseconds as second argument to logging function (options.logging).</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.returning</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If true, append RETURNING * to get back all values; if an array of column names, append RETURNING &lt;columns&gt; to get back specific columns (Postgres only)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.searchPath</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: DEFAULT</li></ul></td>
      <td data-ice="description"><p>An optional parameter to specify the schema search_path (Postgres only)</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-count">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">count</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2023">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Count the number of records matching the provided where clause.</p>
<p>If you provide an <code>include</code> option, the number of matching associations will be counted instead.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.where</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>A hash of search attributes.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.include</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Include options. See <code>find</code> for details</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.paranoid</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Set <code>true</code> to count only non-deleted records. Can be used on models with <code>paranoid</code> enabled</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.distinct</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Apply COUNT(DISTINCT(col)) on primary key or on options.col.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.col</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Column on which COUNT() should be applied</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.attributes</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Used in conjunction with <code>group</code></p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.group</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>For creating complex counts. Will return multiple rows as needed.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.benchmark</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Pass query execution time in milliseconds as second argument to logging function (options.logging).</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.searchPath</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: DEFAULT</li></ul></td>
      <td data-ice="description"><p>An optional parameter to specify the schema search_path (Postgres only)</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-create">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">create</span><span class="code" data-ice="signature">(values: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2221">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Builds a new model instance and calls save on it.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">values</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>hash of data values to create new record with</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>build and query options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.raw</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If set to true, values will ignore field and virtual setters.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.isNewRecord</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Is this new record</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.include</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>an array of include options - Used to build prefetched/included model instances. See <code>set</code></p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.fields</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>If set, only columns matching those in fields will be saved</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.fields</td>
      <td data-ice="type" class="code"><span><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span><span>[]</span></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>An optional array of strings, representing database columns. If fields is provided, only those columns will be validated and saved.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.silent</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If true, the updatedAt timestamp will not be updated.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.validate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>If false, validations won't be run.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.hooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Run before and after create / update + validate hooks</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.benchmark</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Pass query execution time in milliseconds as second argument to logging function (options.logging).</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.searchPath</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: DEFAULT</li></ul></td>
      <td data-ice="description"><p>An optional parameter to specify the schema search_path (Postgres only)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.returning</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Return the affected rows (only for postgres)</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#static-method-build">Model.build</a></span></span></li>
<li><span><span><a href="/v5/class/lib/model.js~Model.html#instance-method-save">Model.save</a></span></span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-decrement">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">decrement</span><span class="code" data-ice="signature">(fields: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span><span>[]</span></span>, ?<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</span>
    <span class="right-info">
      
      <span class="since" data-ice="since">since 4.36.0</span>
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber3422">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Decrement the value of one or more columns. This is done in the database, which means it does not use the values currently stored on the Instance. The decrement is done using a
<code>sql SET column = column - X WHERE foo = 'bar'</code> query. To get the correct value after a decrement into the Instance you should do a reload.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">fields</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>If a string is provided, that column is incremented by the value of <code>by</code> given in options. If an array is provided, the same is true for each column. If and object is provided, each column is incremented by the value given.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>decrement options, similar to increment</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span><span>[]</span></span>, ?<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</td>
          <td class="return-desc" data-ice="returnDescription"><p>returns an array of affected rows and affected count with <code>options.returning: true</code>, whenever supported by dialect</p>
</td>
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      <div class="example-caption" data-ice="exampleCaption">decrement number by 1</div>
      <pre class="prettyprint source-code"><code data-ice="exampleCode">Model.decrement('number', { where: { foo: 'bar' });</code></pre>
    </div>
<div class="example-doc" data-ice="exampleDoc">
      <div class="example-caption" data-ice="exampleCaption">decrement number and count by 2</div>
      <pre class="prettyprint source-code"><code data-ice="exampleCode">Model.decrement(['number', 'count'], { by: 2, where: { foo: 'bar' } });</code></pre>
    </div>
<div class="example-doc" data-ice="exampleDoc">
      <div class="example-caption" data-ice="exampleCaption">decrement answer by 42, and decrement tries by -1</div>
      <pre class="prettyprint source-code"><code data-ice="exampleCode">// `by` is ignored, since each column has its own value
Model.decrement({ answer: 42, tries: -1}, { by: 2, where: { foo: 'bar' } });</code></pre>
    </div>
</div>

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#static-method-increment">Model.increment</a></span></span></li>
<li><span><span><a href="/v5/class/lib/model.js~Model.html#instance-method-reload">Model#reload</a></span></span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-describe">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">describe</span><span class="code" data-ice="signature">(schema: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber3261">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Run a describe query on the table.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">schema</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>schema name to search table in</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>query options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></td>
          <td class="return-desc" data-ice="returnDescription"><p>hash of attributes and their types</p>
</td>
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-destroy">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">destroy</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2891">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Delete multiple instances, or set their deletedAt timestamp to the current time if <code>paranoid</code> is enabled.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>destroy options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.where</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Filter the destroy</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.hooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Run before / after bulk destroy hooks?</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.individualHooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If set to true, destroy will SELECT all records matching the where parameter and will execute before / after destroy hooks on each row</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.limit</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>How many rows to delete</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.force</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Delete instead of setting deletedAt to current timestamp (only applicable if <code>paranoid</code> is enabled)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.truncate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If set to true, dialects that support it will use TRUNCATE instead of DELETE FROM. If a table is truncated the where and limit options are ignored</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.cascade</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Only used in conjunction with TRUNCATE. Truncates  all tables that have foreign-key references to the named table, or to any tables added to the group due to CASCADE.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.restartIdentity</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Only used in conjunction with TRUNCATE. Automatically restart sequences owned by columns of the truncated table.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.benchmark</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Pass query execution time in milliseconds as second argument to logging function (options.logging).</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</td>
          <td class="return-desc" data-ice="returnDescription"><p>The number of destroyed rows</p>
</td>
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-drop">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">drop</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber1389">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Drop the table represented by this Model</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>drop options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.cascade</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Also drop all objects depending on this table, such as views. Only works in postgres</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.benchmark</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Pass query execution time in milliseconds as second argument to logging function (options.logging).</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-findAll">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">findAll</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber1683">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Search for multiple instances.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>A hash of options to describe the scope of the search</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.where</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>A hash of attributes to describe your search. See above for examples.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.attributes</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>&gt; | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>A list of the attributes that you want to select, or an object with <code>include</code> and <code>exclude</code> keys. To rename an attribute, you can pass an array, with two elements - the first is the name of the attribute in the DB (or some kind of expression such as <code>Sequelize.literal</code>, <code>Sequelize.fn</code> and so on), and the second is the name you want the attribute to have in the returned instance</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.attributes.include</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>&gt;</td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Select all the attributes of the model, plus some additional ones. Useful for aggregations, e.g. <code>{ attributes: { include: [[sequelize.fn('COUNT', sequelize.col('id')), 'total']] }</code></p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.attributes.exclude</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>&gt;</td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Select all the attributes of the model, except some few. Useful for security purposes e.g. <code>{ attributes: { exclude: ['password'] } }</code></p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.paranoid</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>If true, only non-deleted records will be returned. If false, both deleted and non-deleted records will be returned. Only applies if <code>options.paranoid</code> is true for the model.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.include</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>|<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>|<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>&gt;</td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>A list of associations to eagerly load using a left join. Supported is either <code>{ include: [ Model1, Model2, ...]}</code> or <code>{ include: [{ model: Model1, as: 'Alias' }]}</code> or <code>{ include: ['Alias']}</code>. If your association are set up with an <code>as</code> (eg. <code>X.hasMany(Y, { as: 'Z }</code>, you need to specify Z in the as attribute when eager loading Y).</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.include[].model</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The model you want to eagerly load</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.include[].as</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The alias of the relation, in case the model you want to eagerly load is aliased. For <code>hasOne</code> / <code>belongsTo</code>, this should be the singular name, and for <code>hasMany</code>, it should be the plural</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.include[].association</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/associations/base.js~Association.html">Association</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The association you want to eagerly load. (This can be used instead of providing a model/as pair)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.include[].where</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Where clauses to apply to the child models. Note that this converts the eager load to an inner join, unless you explicitly set <code>required: false</code></p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.include[].or</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Whether to bind the ON and WHERE clause together by OR instead of AND.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.include[].on</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Supply your own ON condition for the join.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.include[].attributes</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>&gt;</td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>A list of attributes to select from the child model</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.include[].required</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>If true, converts to an inner join, which means that the parent model will only be loaded if it has any matching children. True if <code>include.where</code> is set, false otherwise.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.include[].right</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>If true, converts to a right join if dialect support it. Ignored if <code>include.required</code> is true.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.include[].separate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>If true, runs a separate query to fetch the associated instances, only supported for hasMany associations</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.include[].limit</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Limit the joined rows, only supported with include.separate=true</p>
</td>
    </tr>
<tr data-ice="property" data-depth="3">
      <td data-ice="name" class="code" data-depth="3">options.include[].through.where</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Filter on the join model for belongsToMany relations</p>
</td>
    </tr>
<tr data-ice="property" data-depth="3">
      <td data-ice="name" class="code" data-depth="3">options.include[].through.attributes</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>A list of attributes to select from the join model for belongsToMany relations</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.include[].include</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>|<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>|<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>&gt;</td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Load further nested related models</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.include[].duplicating</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Mark the include as duplicating, will prevent a subquery from being used.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.order</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="/v5/class/lib/sequelize.js~Sequelize.html#static-method-fn">fn</a></span> | <span><a href="/v5/class/lib/sequelize.js~Sequelize.html#static-method-col">col</a></span> | <span><a href="/v5/class/lib/sequelize.js~Sequelize.html#static-method-literal">literal</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Specifies an ordering. Using an array, you can provide several columns / functions to order by. Each element can be further wrapped in a two-element array. The first element is the column / function to order by, the second is the direction. For example: <code>order: [['name', 'DESC']]</code>. In this way the column will be escaped, but the direction will not.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.limit</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Limit for result</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.offset</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Offset for result</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.lock</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Lock the selected rows. Possible options are transaction.LOCK.UPDATE and transaction.LOCK.SHARE. Postgres also supports transaction.LOCK.KEY_SHARE, transaction.LOCK.NO_KEY_UPDATE and specific model locks with joins. See <a href="/v5/class/lib/transaction.js~Transaction.html#static-get-LOCK">transaction.LOCK for an example</a></p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.skipLocked</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Skip locked rows. Only supported in Postgres.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.raw</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Return raw result. See sequelize.query for more information.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.benchmark</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Pass query execution time in milliseconds as second argument to logging function (options.logging).</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.having</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Having options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.searchPath</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: DEFAULT</li></ul></td>
      <td data-ice="description"><p>An optional parameter to specify the schema search_path (Postgres only)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.rejectOnEmpty</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Throws an error when no records found</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      <div class="example-caption" data-ice="exampleCaption">Simple search using AND and =</div>
      <pre class="prettyprint source-code"><code data-ice="exampleCode">Model.findAll({
  where: {
    attr1: 42,
    attr2: 'cake'
  }
})

# WHERE attr1 = 42 AND attr2 = 'cake'</code></pre>
    </div>
<div class="example-doc" data-ice="exampleDoc">
      <div class="example-caption" data-ice="exampleCaption">Using greater than, less than etc.</div>
      <pre class="prettyprint source-code"><code data-ice="exampleCode">const {gt, lte, ne, in: opIn} = Sequelize.Op;

Model.findAll({
  where: {
    attr1: {
      [gt]: 50
    },
    attr2: {
      [lte]: 45
    },
    attr3: {
      [opIn]: [1,2,3]
    },
    attr4: {
      [ne]: 5
    }
  }
})

# WHERE attr1 &gt; 50 AND attr2 &lt;= 45 AND attr3 IN (1,2,3) AND attr4 != 5</code></pre>
    </div>
<div class="example-doc" data-ice="exampleDoc">
      <div class="example-caption" data-ice="exampleCaption">Queries using OR</div>
      <pre class="prettyprint source-code"><code data-ice="exampleCode">const {or, and, gt, lt} = Sequelize.Op;

Model.findAll({
  where: {
    name: 'a project',
    [or]: [
      {id: [1, 2, 3]},
      {
        [and]: [
          {id: {[gt]: 10}},
          {id: {[lt]: 100}}
        ]
      }
    ]
  }
});

# WHERE `Model`.`name` = 'a project' AND (`Model`.`id` IN (1, 2, 3) OR (`Model`.`id` &gt; 10 AND `Model`.`id` &lt; 100));</code></pre>
    </div>
</div>

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span>Operators</span> for possible operators
__Alias__: _all_

The promise is resolved with an array of Model instances if the query succeeds._</span></li>
<li><span><span><a href="/v5/class/lib/sequelize.js~Sequelize.html#instance-method-query">Sequelize#query</a></span></span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-findAndCountAll">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">findAndCountAll</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;{count: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, rows: <span><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span><span>[]</span></span>}&gt;<!--{count:--></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2089">source</a></span></span>
    </span>
  </span></h3>

  
  
  
  <div data-ice="description"><p>Find all the rows matching your query, within a specified offset / limit, and get the total number of rows matching your query. This is very useful for paging</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>See findAll options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;{count: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, rows: <span><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span><span>[]</span></span>}&gt;<!--{count:--></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">Model.findAndCountAll({
  where: ...,
  limit: 12,
  offset: 12
}).then(result =&gt; {
  ...
})

# In the above example, `result.rows` will contain rows 13 through 24, while `result.count` will return the total number of rows that matched your query.

# When you add includes, only those which are required (either because they have a where clause, or because `required` is explicitly set to true on the include) will be added to the count part.

# Suppose you want to find all users who have a profile attached:

User.findAndCountAll({
  include: [
     { model: Profile, required: true}
  ],
  limit 3
});

# Because the include for `Profile` has `required` set it will result in an inner join, and only the users who have a profile will be counted. If we remove `required` from the include, both users with and without profiles will be counted</code></pre>
    </div>
</div>

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#static-method-findAll">Model.findAll</a></span> for a specification of find and query options</span></li>
<li><span><span><a href="/v5/class/lib/model.js~Model.html#static-method-count">Model.count</a></span> for a specification of count options</span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-findByPk">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">findByPk</span><span class="code" data-ice="signature">(param: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span>Buffer</span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber1873">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Search for a single instance by its primary key._</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">param</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span>Buffer</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The value of the desired instance's primary key.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>find options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.searchPath</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: DEFAULT</li></ul></td>
      <td data-ice="description"><p>An optional parameter to specify the schema search_path (Postgres only)</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#static-method-findAll">Model.findAll</a></span>           for a full explanation of options, Note that options.where is not supported.</span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-findCreateFind">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">findCreateFind</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2397">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>A more performant findOrCreate that will not work under a transaction (at least not in postgres)
Will execute a find call, if empty then attempt to create, if unique constraint then attempt to find again</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>find options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.where</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>A hash of search attributes. If <code>where</code> is a plain object it will be appended with defaults to build a new instance.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.defaults</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Default values to use if creating a new instance</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#static-method-findAll">Model.findAll</a></span> for a full specification of find and options</span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-findOne">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">findOne</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber1907">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Search for a single instance. This applies LIMIT 1, so the listener will always be called with a single instance.</p>
<p><strong>Alias</strong>: <em>find</em></p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>A hash of options to describe the scope of the search</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.searchPath</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: DEFAULT</li></ul></td>
      <td data-ice="description"><p>An optional parameter to specify the schema search_path (Postgres only)</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#static-method-findAll">Model.findAll</a></span> for an explanation of options</span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-findOrBuild">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">findOrBuild</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2244">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Find a row that matches the query, or build (but don't save) the row if none is found.
The successful result of the promise will be (instance, built)</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>find options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.where</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>A hash of search attributes. If <code>where</code> is a plain object it will be appended with defaults to build a new instance.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.defaults</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Default values to use if building a new instance</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-findOrCreate">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">findOrCreate</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2288">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Find a row that matches the query, or build and save the row if none is found
The successful result of the promise will be (instance, created)</p>
<p>If no transaction is passed in the <code>options</code> object, a new transaction will be created internally, to prevent the race condition where a matching row is created by another connection after the find but before the insert call.
However, it is not always possible to handle this case in SQLite, specifically if one transaction inserts and another tries to select before the first one has committed. In this case, an instance of sequelize. TimeoutError will be thrown instead.
If a transaction is created, a savepoint will be created instead, and any unique constraint violation will be handled internally.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>find and create options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.where</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>where A hash of search attributes. If <code>where</code> is a plain object it will be appended with defaults to build a new instance.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.defaults</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Default values to use if creating a new instance</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#static-method-findAll">Model.findAll</a></span> for a full specification of find and options</span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-getTableName">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">getTableName</span><span class="code" data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber1442">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Get the table name of the model, taking schema into account. The method will return The name as a string if the model has no schema,
or an object with <code>tableName</code>, <code>schema</code> and <code>delimiter</code> properties.</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-hasMany">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">hasMany</span><span class="code" data-ice="signature">(target: <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/associations/has-many.js~HasMany.html">HasMany</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4439">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Creates a 1:m association between this (the source) and the provided target.
The foreign key is added on the target.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">target</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Target model</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>hasMany association options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.hooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Set to true to run before-/afterDestroy hooks when an associated model is deleted because of a cascade. For example if <code>User.hasOne(Profile, {onDelete: 'cascade', hooks:true})</code>, the before-/afterDestroy hooks for profile will be called when a user is deleted. Otherwise the profile will be deleted without invoking any hooks</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.as</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The alias of this model. If you provide a string, it should be plural, and will be singularized using node.inflection. If you want to control the singular version yourself, provide an object with <code>plural</code> and <code>singular</code> keys. See also the <code>name</code> option passed to <code>sequelize.define</code>. If you create multiple associations between the same tables, you should provide an alias to be able to distinguish between them. If you provide an alias when creating the association, you should provide the same alias when eager loading and when getting associated models. Defaults to the pluralized name of target</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.foreignKey</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The name of the foreign key in the target table or an object representing the type definition for the foreign column (see <code>Sequelize.define</code> for syntax). When using an object, you can add a <code>name</code> property to set the name of the column. Defaults to the name of source + primary key of source</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.sourceKey</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The name of the field to use as the key for the association in the source table. Defaults to the primary key of the source table</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.scope</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>A key/value set that will be used for association create and find defaults on the target. (sqlite not supported for N:M)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.onDelete</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: 'SET&nbsp;NULL|CASCADE'</li></ul></td>
      <td data-ice="description"><p>SET NULL if foreignKey allows nulls, CASCADE if otherwise</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.onUpdate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: 'CASCADE'</li></ul></td>
      <td data-ice="description"><p>Set <code>ON UPDATE</code></p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.constraints</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Should on update and on delete constraints be enabled on the foreign key.</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="/v5/class/lib/associations/has-many.js~HasMany.html">HasMany</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">User.hasMany(Profile) // This will add userId to the profile table</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-hasOne">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">hasOne</span><span class="code" data-ice="signature">(target: <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/associations/has-one.js~HasOne.html">HasOne</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4495">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Creates an association between this (the source) and the provided target. The foreign key is added on the target.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">target</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Target model</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>hasOne association options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.hooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Set to true to run before-/afterDestroy hooks when an associated model is deleted because of a cascade. For example if <code>User.hasOne(Profile, {onDelete: 'cascade', hooks:true})</code>, the before-/afterDestroy hooks for profile will be called when a user is deleted. Otherwise the profile will be deleted without invoking any hooks</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.as</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The alias of this model, in singular form. See also the <code>name</code> option passed to <code>sequelize.define</code>. If you create multiple associations between the same tables, you should provide an alias to be able to distinguish between them. If you provide an alias when creating the association, you should provide the same alias when eager loading and when getting associated models. Defaults to the singularized name of target</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.foreignKey</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The name of the foreign key attribute in the target model or an object representing the type definition for the foreign column (see <code>Sequelize.define</code> for syntax). When using an object, you can add a <code>name</code> property to set the name of the column. Defaults to the name of source + primary key of source</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.sourceKey</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The name of the attribute to use as the key for the association in the source table. Defaults to the primary key of the source table</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.onDelete</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: 'SET&nbsp;NULL|CASCADE'</li></ul></td>
      <td data-ice="description"><p>SET NULL if foreignKey allows nulls, CASCADE if otherwise</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.onUpdate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: 'CASCADE'</li></ul></td>
      <td data-ice="description"><p>Sets 'ON UPDATE'</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.constraints</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Should on update and on delete constraints be enabled on the foreign key.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.uniqueKey</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The custom name for unique constraint.</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="/v5/class/lib/associations/has-one.js~HasOne.html">HasOne</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">User.hasOne(Profile) // This will add userId to the profile table</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-increment">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">increment</span><span class="code" data-ice="signature">(fields: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span><span>[]</span></span>, ?<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber3335">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Increment the value of one or more columns. This is done in the database, which means it does not use the values currently stored on the Instance. The increment is done using a
<code>SET column = column + X WHERE foo = 'bar'</code> query. To get the correct value after an increment into the Instance you should do a reload.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">fields</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>If a string is provided, that column is incremented by the value of <code>by</code> given in options. If an array is provided, the same is true for each column. If and object is provided, each column is incremented by the value given.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>increment options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.where</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>conditions hash</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.by</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: 1</li></ul></td>
      <td data-ice="description"><p>The number to increment by</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.silent</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If true, the updatedAt timestamp will not be updated.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.searchPath</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: DEFAULT</li></ul></td>
      <td data-ice="description"><p>An optional parameter to specify the schema search_path (Postgres only)</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span><span>[]</span></span>, ?<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</td>
          <td class="return-desc" data-ice="returnDescription"><p>returns an array of affected rows and affected count with <code>options.returning: true</code>, whenever supported by dialect</p>
</td>
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      <div class="example-caption" data-ice="exampleCaption">increment number by 1</div>
      <pre class="prettyprint source-code"><code data-ice="exampleCode">Model.increment('number', { where: { foo: 'bar' });</code></pre>
    </div>
<div class="example-doc" data-ice="exampleDoc">
      <div class="example-caption" data-ice="exampleCaption">increment number and count by 2</div>
      <pre class="prettyprint source-code"><code data-ice="exampleCode">Model.increment(['number', 'count'], { by: 2, where: { foo: 'bar' } });</code></pre>
    </div>
<div class="example-doc" data-ice="exampleDoc">
      <div class="example-caption" data-ice="exampleCaption">increment answer by 42, and decrement tries by 1</div>
      <pre class="prettyprint source-code"><code data-ice="exampleCode">// `by` is ignored, as each column has its own value
Model.increment({ answer: 42, tries: -1}, { by: 2, where: { foo: 'bar' } });</code></pre>
    </div>
</div>

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#instance-method-reload">Model#reload</a></span></span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-init">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">init</span><span class="code" data-ice="signature">(attributes: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber926">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Initialize a model, representing a table in the DB, with attributes and options.</p>
<p>The table columns are defined by the hash that is given as the first argument.
Each attribute of the hash represents a column.</p>
<p>For more about <a href="/v5/manual/models-definition.html#validations">Validations</a></p>
<p>More examples, <a href="/v5/manual/models-definition.html">Model Definition</a></p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">attributes</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>An object, where each attribute is a column of the table. Each column can be either a DataType, a string or a type-description object, with the properties described below:</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">attributes.column</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="/v5/variable/index.html#static-variable-DataTypes">DataTypes</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The description of a database column</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.type</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="/v5/variable/index.html#static-variable-DataTypes">DataTypes</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>A string or a data type</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.allowNull</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>If false, the column will have a NOT NULL constraint, and a not null validation will be run before an instance is saved.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.defaultValue</td>
      <td data-ice="type" class="code"><span>any</span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: null</li></ul></td>
      <td data-ice="description"><p>A literal default value, a JavaScript function, or an SQL function (see <code>sequelize.fn</code>)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.unique</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If true, the column will get a unique constraint. If a string is provided, the column will be part of a composite unique index. If multiple columns have the same string, they will be part of the same unique index</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.primaryKey</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If true, this attribute will be marked as primary key</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.field</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: null</li></ul></td>
      <td data-ice="description"><p>If set, sequelize will map the attribute name to a different name in the database</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.autoIncrement</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If true, this column will be set to auto increment</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.autoIncrementIdentity</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If true, combined with autoIncrement=true, will use Postgres <code>GENERATED BY DEFAULT AS IDENTITY</code> instead of <code>SERIAL</code>. Postgres 10+ only.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.comment</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: null</li></ul></td>
      <td data-ice="description"><p>Comment for this column</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.references</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: null</li></ul></td>
      <td data-ice="description"><p>An object with reference configurations</p>
</td>
    </tr>
<tr data-ice="property" data-depth="3">
      <td data-ice="name" class="code" data-depth="3">attributes.column.references.model</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>If this column references another table, provide it here as a Model, or a string</p>
</td>
    </tr>
<tr data-ice="property" data-depth="3">
      <td data-ice="name" class="code" data-depth="3">attributes.column.references.key</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: 'id'</li></ul></td>
      <td data-ice="description"><p>The column of the foreign table that this column references</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.onUpdate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>What should happen when the referenced key is updated. One of CASCADE, RESTRICT, SET DEFAULT, SET NULL or NO ACTION</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.onDelete</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>What should happen when the referenced key is deleted. One of CASCADE, RESTRICT, SET DEFAULT, SET NULL or NO ACTION</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.get</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Provide a custom getter for this column. Use <code>this.getDataValue(String)</code> to manipulate the underlying values.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.set</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Provide a custom setter for this column. Use <code>this.setDataValue(String, Value)</code> to manipulate the underlying values.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">attributes.column.validate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>An object of validations to execute for this column every time the model is saved. Can be either the name of a validation provided by validator.js, a validation function provided by extending validator.js (see the <code>DAOValidator</code> property for more details), or a custom validation function. Custom validation functions are called with the value of the field and the instance itself as the <code>this</code> binding, and can possibly take a second callback argument, to signal that they are asynchronous. If the validator is sync, it should throw in the case of a failed validation; if it is async, the callback should be called with the error text.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>These options are merged with the default define options provided to the Sequelize constructor</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.sequelize</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Define the sequelize instance to attach to the new Model. Throw error if none is provided.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.modelName</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Set name of the model. By default its same as Class name.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.defaultScope</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: {}</li></ul></td>
      <td data-ice="description"><p>Define the default search scope to use for this model. Scopes have the same form as the options passed to find / findAll</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.scopes</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>More scopes, defined in the same way as defaultScope above. See <code>Model.scope</code> for more information about how scopes are defined, and what you can do with them</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.omitNull</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Don't persist null values. This means that all columns with null values will not be saved</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.timestamps</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Adds createdAt and updatedAt timestamps to the model.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.paranoid</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Calling <code>destroy</code> will not delete the model, but instead set a <code>deletedAt</code> timestamp if this is true. Needs <code>timestamps=true</code> to work</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.underscored</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Add underscored field to all attributes, this covers user defined attributes, timestamps and foreign keys. Will not affect attributes with explicitly set <code>field</code> option</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.freezeTableName</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If freezeTableName is true, sequelize will not try to alter the model name to get the table name. Otherwise, the model name will be pluralized</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.name</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>An object with two attributes, <code>singular</code> and <code>plural</code>, which are used when this model is associated to others.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.name.singular</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: Utils.singularize(modelName)</li></ul></td>
      <td data-ice="description"><p>Singular name for model</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.name.plural</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: Utils.pluralize(modelName)</li></ul></td>
      <td data-ice="description"><p>Plural name for model</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.indexes</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>&gt;</td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>indexes definitions</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.indexes[].name</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The name of the index. Defaults to model name + _ + fields concatenated</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.indexes[].type</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Index type. Only used by mysql. One of <code>UNIQUE</code>, <code>FULLTEXT</code> and <code>SPATIAL</code></p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.indexes[].using</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The method to create the index by (<code>USING</code> statement in SQL). BTREE and HASH are supported by mysql and postgres, and postgres additionally supports GIST and GIN.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.indexes[].operator</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Specify index operator.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.indexes[].unique</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Should the index by unique? Can also be triggered by setting type to <code>UNIQUE</code></p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.indexes[].concurrently</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>PostgresSQL will build the index without taking any write locks. Postgres only</p>
</td>
    </tr>
<tr data-ice="property" data-depth="2">
      <td data-ice="name" class="code" data-depth="2">options.indexes[].fields</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>|<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>&gt;</td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>An array of the fields to index. Each field can either be a string containing the name of the field, a sequelize object (e.g <code>sequelize.fn</code>), or an object with the following attributes: <code>attribute</code> (field name), <code>length</code> (create a prefix index of length chars), <code>order</code> (the direction the column should be sorted in), <code>collate</code> (the collation (sort order) for the column)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.createdAt</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Override the name of the createdAt attribute if a string is provided, or disable it if false. Timestamps must be true. Underscored field will be set with underscored setting.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.updatedAt</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Override the name of the updatedAt attribute if a string is provided, or disable it if false. Timestamps must be true. Underscored field will be set with underscored setting.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.deletedAt</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Override the name of the deletedAt attribute if a string is provided, or disable it if false. Timestamps must be true. Underscored field will be set with underscored setting.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.tableName</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Defaults to pluralized model name, unless freezeTableName is true, in which case it uses model name verbatim</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.schema</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: 'public'</li></ul></td>
      <td data-ice="description"><p>schema</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.engine</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Specify engine for model's table</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.charset</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Specify charset for model's table</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.comment</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Specify comment for model's table</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.collate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Specify collation for model's table</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.initialAutoIncrement</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Set the initial AUTO_INCREMENT value for the table in MySQL.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.hooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>An object of hook function that are called before and after certain lifecycle events. The possible hooks are: beforeValidate, afterValidate, validationFailed, beforeBulkCreate, beforeBulkDestroy, beforeBulkUpdate, beforeCreate, beforeDestroy, beforeUpdate, afterCreate, beforeSave, afterDestroy, afterUpdate, afterBulkCreate, afterSave, afterBulkDestroy and afterBulkUpdate. See Hooks for more information about hook functions and their signatures. Each property can either be a function, or an array of functions.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.validate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>An object of model wide validations. Validations have access to all model values via <code>this</code>. If the validator function takes an argument, it is assumed to be async, and is called with a callback that accepts an optional error.</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">Project.init({
  columnA: {
    type: Sequelize.BOOLEAN,
    validate: {
      is: ['[a-z]','i'],        // will only allow letters
      max: 23,                  // only allow values &lt;= 23
      isIn: {
        args: [['en', 'zh']],
        msg: "Must be English or Chinese"
      }
    },
    field: 'column_a'
    // Other attributes here
  },
  columnB: Sequelize.STRING,
  columnC: 'MY VERY OWN COLUMN TYPE'
}, {sequelize})

sequelize.models.modelName // The model will now be available in models under the class name</code></pre>
    </div>
</div>

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/variable/index.html#static-variable-DataTypes">DataTypes</a></span></span></li>
<li><span><span>Hooks</span></span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-max">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">max</span><span class="code" data-ice="signature">(field: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span>*</span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2121">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Find the maximum value of field</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">field</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>attribute / field name</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>See aggregate</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span>*</span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#static-method-aggregate">Model.aggregate</a></span> for options</span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-min">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">min</span><span class="code" data-ice="signature">(field: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span>*</span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2136">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Find the minimum value of field</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">field</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>attribute / field name</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>See aggregate</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span>*</span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#static-method-aggregate">Model.aggregate</a></span> for options</span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-removeAttribute">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">removeAttribute</span><span class="code" data-ice="signature">(attribute: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>)</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber1263">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Remove attribute from model definition</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">attribute</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>name of attribute to remove</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-restore">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">restore</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2978">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Restore multiple instances if <code>paranoid</code> is enabled.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>restore options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.where</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Filter the restore</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.hooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Run before / after bulk restore hooks?</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.individualHooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If set to true, restore will find all records within the where parameter and will execute before / after bulkRestore hooks on each row</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.limit</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>How many rows to undelete (only for mysql)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.benchmark</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Pass query execution time in milliseconds as second argument to logging function (options.logging).</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-schema">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">schema</span><span class="code" data-ice="signature">(schema: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber1418">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Apply a schema to this model. For postgres, this will actually place the schema in front of the table name - <code>"schema"."tableName"</code>,
while the schema will be prepended to the table name for mysql and sqlite - <code>'schema.tablename'</code>.</p>
<p>This method is intended for use cases where the same model is needed in multiple schemas. In such a use case it is important
to call <code>model.schema(schema, [options]).sync()</code> for each model to ensure the models are created in the correct schema.</p>
<p>If a single default schema per model is needed, set the <code>options.schema='schema'</code> parameter during the <code>define()</code> call
for the model.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">schema</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The name of the schema</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>schema options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.schemaDelimiter</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: '.'</li></ul></td>
      <td data-ice="description"><p>The character(s) that separates the schema name from the table name</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.benchmark</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Pass query execution time in milliseconds as second argument to logging function (options.logging).</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/sequelize.js~Sequelize.html#instance-method-define">Sequelize#define</a></span> for more information about setting a default schema.</span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-scope">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">scope</span><span class="code" data-ice="signature">(option: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber1526">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Apply a scope created in <code>define</code> to the model.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">option</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>nullable: true</li></ul></td>
      <td data-ice="description"><p>The scope(s) to apply. Scopes can either be passed as consecutive arguments, or as an array of arguments. To apply simple scopes and scope functions with no arguments, pass them as strings. For scope function, pass an object, with a <code>method</code> property. The value can either be a string, if the method does not take any arguments, or an array, where the first element is the name of the method, and consecutive elements are arguments to that method. Pass null to remove all scopes, including the default.</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></td>
          <td class="return-desc" data-ice="returnDescription"><p>A reference to the model, with the scope(s) applied. Calling scope again on the returned model will clear the previous scope.</p>
</td>
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      <div class="example-caption" data-ice="exampleCaption">how to create scopes</div>
      <pre class="prettyprint source-code"><code data-ice="exampleCode">const Model = sequelize.define('model', attributes, {
  defaultScope: {
    where: {
      username: 'dan'
    },
    limit: 12
  },
  scopes: {
    isALie: {
      where: {
        stuff: 'cake'
      }
    },
    complexFunction: function(email, accessLevel) {
      return {
        where: {
          email: {
            [Op.like]: email
          },
          access_level {
            [Op.gte]: accessLevel
          }
        }
      }
    }
  }
})

# As you have defined a default scope, every time you do Model.find, the default scope is appended to your query. Here's a couple of examples:

Model.findAll() // WHERE username = 'dan'
Model.findAll({ where: { age: { [Op.gt]: 12 } } }) // WHERE age &gt; 12 AND username = 'dan'</code></pre>
    </div>
<div class="example-doc" data-ice="exampleDoc">
      <div class="example-caption" data-ice="exampleCaption">To invoke scope functions you can do</div>
      <pre class="prettyprint source-code"><code data-ice="exampleCode">Model.scope({ method: ['complexFunction', 'dan@sequelize.com', 42]}).findAll()
// WHERE email like 'dan@sequelize.com%' AND access_level &gt;= 42</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-sum">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">sum</span><span class="code" data-ice="signature">(field: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2151">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Find the sum of field</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">field</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>attribute / field name</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>See aggregate</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#static-method-aggregate">Model.aggregate</a></span> for options</span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-sync">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">sync</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber1278">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Sync this Model to the DB, that is create the table.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>sync options</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/sequelize.js~Sequelize.html#instance-method-sync">Sequelize#sync</a></span> for options</span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-truncate">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">truncate</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2867">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Truncate all instances of the model. This is a convenient method for Model.destroy({ truncate: true }).</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The options passed to Model.destroy in addition to truncate</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.cascade</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default:  false</li></ul></td>
      <td data-ice="description"><p>Truncates all tables that have foreign-key references to the named table, or to any tables added to the group due to CASCADE.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.restartIdentity</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Automatically restart sequences owned by columns of the truncated table.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>A function that logs sql queries, or false for no logging</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.benchmark</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Pass query execution time in milliseconds as second argument to logging function (options.logging).</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.searchPath</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: DEFAULT</li></ul></td>
      <td data-ice="description"><p>An optional parameter to specify the schema search_path (Postgres only)</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#static-method-destroy">Model.destroy</a></span> for more information</span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-unscoped">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">unscoped</span><span class="code" data-ice="signature">(): <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber1451">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Get un-scoped model</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-update">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">update</span><span class="code" data-ice="signature">(values: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>, <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber3053">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Update multiple instances that match the where options.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">values</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>hash of values to update</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>update options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.where</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Options to describe the scope of the search.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.paranoid</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>If true, only non-deleted records will be updated. If false, both deleted and non-deleted records will be updated. Only applies if <code>options.paranoid</code> is true for the model.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.fields</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Fields to update (defaults to all fields)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.validate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Should each row be subject to validation before it is inserted. The whole insert will fail if one row fails validation</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.hooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Run before / after bulk update hooks?</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.sideEffects</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Whether or not to update the side effects of any virtual setters.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.individualHooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Run before / after update hooks?. If true, this will execute a SELECT followed by individual UPDATEs. A select is needed, because the row data needs to be passed to the hooks</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.returning</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Return the affected rows (only for postgres)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.limit</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>How many rows to update (only for mysql and mariadb, implemented as TOP(n) for MSSQL; for sqlite it is supported only when rowid is present)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.benchmark</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Pass query execution time in milliseconds as second argument to logging function (options.logging).</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.silent</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If true, the updatedAt timestamp will not be updated.</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>, <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span>&gt;&gt;</td>
          <td class="return-desc" data-ice="returnDescription"><p>The promise returns an array with one or two elements. The first element is always the number
of affected rows, while the second element is the actual affected rows (only supported in postgres with <code>options.returning</code> true.)</p>
</td>
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-method-upsert">
    <span class="access" data-ice="access">public</span>
    <span data-ice="static">static</span>
    
    
    
    
    <span class="code" data-ice="name">upsert</span><span class="code" data-ice="signature">(values: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber2443">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Insert or update a single row. An update will be executed if a row which matches the supplied values on either the primary key or a unique key is found. Note that the unique index must be defined in your sequelize model and not just in the table. Otherwise you may experience a unique constraint violation, because sequelize fails to identify the row that should be updated.</p>
<p><strong>Implementation details:</strong></p>
<ul>
<li>MySQL - Implemented as a single query <code>INSERT values ON DUPLICATE KEY UPDATE values</code></li>
<li>PostgreSQL - Implemented as a temporary function with exception handling: INSERT EXCEPTION WHEN unique_constraint UPDATE</li>
<li>SQLite - Implemented as two queries <code>INSERT; UPDATE</code>. This means that the update is executed regardless of whether the row already existed or not</li>
<li>MSSQL - Implemented as a single query using <code>MERGE</code> and <code>WHEN (NOT) MATCHED THEN</code>
<strong>Note</strong> that SQLite returns undefined for created, no matter if the row was created or updated. This is because SQLite always runs INSERT OR IGNORE + UPDATE, in a single query, so there is no way to know whether the row was inserted or not.</li>
</ul>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">values</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>hash of values to upsert</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>upsert options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.validate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Run validations before the row is inserted</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.fields</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: Object.keys(this.attributes)</li></ul></td>
      <td data-ice="description"><p>The fields to insert / update. Defaults to all changed fields</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.hooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Run before / after upsert hooks?</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.returning</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Append RETURNING * to get back auto generated values (Postgres only)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.benchmark</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Pass query execution time in milliseconds as second argument to logging function (options.logging).</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.searchPath</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: DEFAULT</li></ul></td>
      <td data-ice="description"><p>An optional parameter to specify the schema search_path (Postgres only)</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</td>
          <td class="return-desc" data-ice="returnDescription"><p>Returns a boolean indicating whether the row was created or updated. For MySQL/MariaDB, it returns <code>true</code> when inserted and <code>false</code> when updated. For Postgres/MSSQL with (options.returning=true), it returns record and created boolean with signature <code>&lt;Model, created&gt;</code>.</p>
</td>
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
</div>
<div data-ice="constructorDetails"><h2 data-ice="title">Public Constructors</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-constructor-constructor">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">constructor</span><span class="code" data-ice="signature">(values: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>)</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber86">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Builds a new model instance.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">values</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: {}</li></ul></td>
      <td data-ice="description"><p>an object of key value pairs</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>instance construction options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.raw</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If set to true, values will ignore field and virtual setters.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.isNewRecord</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Is this a new record</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.include</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>an array of include options - Used to build prefetched/included model instances. See <code>set</code></p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  

  

  

  

  

  

  

  
  
</div>
</div>
<div data-ice="memberDetails"><h2 data-ice="title">Public Members</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-member-isNewRecord">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">isNewRecord</span><span class="code" data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>: <span>*</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber116">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Returns true if this instance has not yet been persisted to the database</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Properties:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">isNewRecord</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties"><div data-ice="properties">
  <h4 data-ice="title">Return Properties:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">isNewRecord</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-get-sequelize">
    <span class="access" data-ice="access">public</span>
    
    <span class="kind" data-ice="kind">get</span>
    
    
    
    <span class="code" data-ice="name">sequelize</span><span class="code" data-ice="signature">: <span><a href="/v5/class/lib/sequelize.js~Sequelize.html">Sequelize</a></span>: <span>*</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber73">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>A reference to the sequelize instance</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Properties:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">sequelize</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="/v5/class/lib/sequelize.js~Sequelize.html">Sequelize</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties"><div data-ice="properties">
  <h4 data-ice="title">Return Properties:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">sequelize</td>
      <td data-ice="type" class="code"><span>*</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"></td>
    </tr>
</tbody>
  </table>
</div>
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/sequelize.js~Sequelize.html">Sequelize</a></span></span></li></ul></div>
  
</div>
</div>
<div data-ice="methodDetails"><h2 data-ice="title">Public Methods</h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-changed">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">changed</span><span class="code" data-ice="signature">(key: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, value: <span>any</span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber3743">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>If changed is called with a string it will return a boolean indicating whether the value of that key in <code>dataValues</code> is different from the value in <code>_previousDataValues</code>.</p>
<p>If changed is called without an argument, it will return an array of keys that have changed.</p>
<p>If changed is called without an argument and no keys have changed, it will return <code>false</code>.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>key to check or change status of</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">value</td>
      <td data-ice="type" class="code"><span>any</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>value to set</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-decrement">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">decrement</span><span class="code" data-ice="signature">(fields: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4359">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Decrement the value of one or more columns. This is done in the database, which means it does not use the values currently stored on the Instance. The decrement is done using a</p>
<pre><code class="lang-sql"><code class="source-code prettyprint">SET column = column - X</code>
</code></pre>
<p>query. The updated instance will be returned by default in Postgres. However, in other dialects, you will need to do a reload to get the new values.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">fields</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>If a string is provided, that column is decremented by the value of <code>by</code> given in options. If an array is provided, the same is true for each column. If and object is provided, each column is decremented by the value given</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>decrement options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.by</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: 1</li></ul></td>
      <td data-ice="description"><p>The number to decrement by</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.silent</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If true, the updatedAt timestamp will not be updated.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.searchPath</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: DEFAULT</li></ul></td>
      <td data-ice="description"><p>An optional parameter to specify the schema search_path (Postgres only)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.returning</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Append RETURNING * to get back auto generated values (Postgres only)</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">instance.decrement('number') // decrement number by 1

instance.decrement(['number', 'count'], { by: 2 }) // decrement number and count by 2

// decrement answer by 42, and tries by 1.
// `by` is ignored, since each column has its own value
instance.decrement({ answer: 42, tries: 1}, { by: 2 })</code></pre>
    </div>
</div>

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#instance-method-reload">Model#reload</a></span></span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-destroy">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">destroy</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4194">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Destroy the row corresponding to this instance. Depending on your setting for paranoid, the row will either be completely deleted, or have its deletedAt timestamp set to the current time.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: {}</li></ul></td>
      <td data-ice="description"><p>destroy options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.force</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If set to true, paranoid models will actually be deleted</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.searchPath</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: DEFAULT</li></ul></td>
      <td data-ice="description"><p>An optional parameter to specify the schema search_path (Postgres only)</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-equals">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">equals</span><span class="code" data-ice="signature">(other: <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4374">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Check whether this and <code>other</code> Instance refer to the same row</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">other</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>Other instance to compare against</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-equalsOneOf">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">equalsOneOf</span><span class="code" data-ice="signature">(others: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4393">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Check if this is equal to one of <code>others</code> by calling equals</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">others</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>An array of instances to check against</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-get">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">get</span><span class="code" data-ice="signature">(key: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span> | <span>any</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber3503">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>If no key is given, returns all values of the instance, also invoking virtual getters.</p>
<p>If key is given and a field or virtual getter is present for the key it will call that getter - else it will return the value for key.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>key to get value of</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>get options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.plain</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If set to true, included instances will be returned as plain objects</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.raw</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If set to true, field and virtual setters will be ignored</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span> | <span>any</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-getDataValue">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">getDataValue</span><span class="code" data-ice="signature">(key: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>any</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber3470">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Get the value of the underlying data value</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>key to look in instance data store</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span>any</span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-increment">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">increment</span><span class="code" data-ice="signature">(fields: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
    <span class="right-info">
      
      <span class="since" data-ice="since">since 4.0.0</span>
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4320">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Increment the value of one or more columns. This is done in the database, which means it does not use the values currently stored on the Instance. The increment is done using a</p>
<pre><code class="lang-sql"><code class="source-code prettyprint">SET column = column + X</code>
</code></pre>
<p>query. The updated instance will be returned by default in Postgres. However, in other dialects, you will need to do a reload to get the new values.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">fields</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>If a string is provided, that column is incremented by the value of <code>by</code> given in options. If an array is provided, the same is true for each column. If and object is provided, each column is incremented by the value given.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.by</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: 1</li></ul></td>
      <td data-ice="description"><p>The number to increment by</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.silent</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If true, the updatedAt timestamp will not be updated.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.searchPath</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: DEFAULT</li></ul></td>
      <td data-ice="description"><p>An optional parameter to specify the schema search_path (Postgres only)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.returning</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Append RETURNING * to get back auto generated values (Postgres only)</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">instance.increment('number') // increment number by 1

instance.increment(['number', 'count'], { by: 2 }) // increment number and count by 2

// increment answer by 42, and tries by 1.
// `by` is ignored, since each column has its own value
instance.increment({ answer: 42, tries: 1}, { by: 2 })</code></pre>
    </div>
</div>

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#instance-method-reload">Model#reload</a></span></span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-isSoftDeleted">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">isSoftDeleted</span><span class="code" data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4239">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Helper method to determine if a instance is "soft deleted".  This is
particularly useful if the implementer renamed the <code>deletedAt</code> attribute
to something different.  This method requires <code>paranoid</code> to be enabled.</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-previous">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">previous</span><span class="code" data-ice="signature">(key: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>any</span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span>any</span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber3766">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Returns the previous value for key from <code>_previousDataValues</code>.</p>
<p>If called without a key, returns the previous values for all values which have changed</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>key to get previous value of</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span>any</span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>&lt;<span>any</span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-reload">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">reload</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4101">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Refresh the current instance in-place, i.e. update the object with current data from the DB and return the same object.
This is different from doing a <code>find(Instance.id)</code>, because that would create and return a new instance. With this method,
all references to the Instance are updated with the new data and no new objects are created.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Options that are passed on to <code>Model.find</code></p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#static-method-findAll">Model.findAll</a></span></span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-restore">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">restore</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4261">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Restore the row corresponding to this instance. Only available for paranoid models.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: {}</li></ul></td>
      <td data-ice="description"><p>restore options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-save">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">save</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber3827">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Validate this instance, and if the validation passes, persist it to the database. It will only save changed fields, and do nothing if no fields have changed.</p>
<p>On success, the callback will be called with this instance. On validation error, the callback will be called with an instance of <code>Sequelize.ValidationError</code>.
This error will have a property for each of the fields for which validation failed, with the error message for that field.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>save options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.fields</td>
      <td data-ice="type" class="code"><span><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span><span>[]</span></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>An optional array of strings, representing database columns. If fields is provided, only those columns will be validated and saved.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.silent</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If true, the updatedAt timestamp will not be updated.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.validate</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>If false, validations won't be run.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.hooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Run before and after create / update + validate hooks</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.logging</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>A function that gets executed while running the query to log the sql.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.transaction</td>
      <td data-ice="type" class="code"><span><a href="/v5/class/lib/transaction.js~Transaction.html">Transaction</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Transaction to run query under</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.searchPath</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: DEFAULT</li></ul></td>
      <td data-ice="description"><p>An optional parameter to specify the schema search_path (Postgres only)</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.returning</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Append RETURNING * to get back auto generated values (Postgres only)</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-set">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">set</span><span class="code" data-ice="signature">(key: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, value: <span>any</span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber3594">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Set is used to update values on the instance (the sequelize representation of the instance that is, remember that nothing will be persisted before you actually call <code>save</code>).
In its most basic form <code>set</code> will update a value stored in the underlying <code>dataValues</code> object. However, if a custom setter function is defined for the key, that function
will be called instead. To bypass the setter, you can pass <code>raw: true</code> in the options object.</p>
<p>If set is called with an object, it will loop over the object, and call set recursively for each key, value pair. If you set raw to true, the underlying dataValues will either be
set directly to the object passed, or used to extend dataValues, if dataValues already contain values.</p>
<p>When set is called, the previous value of the field is stored and sets a changed flag(see <code>changed</code>).</p>
<p>Set can also be used to build instances for associations, if you have values for those.
When using set with associations you need to make sure the property key matches the alias of the association
while also making sure that the proper include options have been set (from .build() or .findOne())</p>
<p>If called with a dot.separated key on a JSON/JSONB attribute it will set the value nested and flag the entire object as changed.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>key to set, it can be string or object. When string it will set that key, for object it will loop over all object properties nd set them.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">value</td>
      <td data-ice="type" class="code"><span>any</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>value to set</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>set options</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.raw</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>If set to true, field and virtual setters will be ignored</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.reset</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>Clear all previously set data values</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="/v5/class/lib/model.js~Model.html">Model</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#static-method-findAll">Model.findAll</a></span> for more information about includes</span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-setDataValue">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">setDataValue</span><span class="code" data-ice="signature">(key: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, value: <span>any</span>)</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber3481">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Update the underlying data value</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">key</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>key to set in instance data store</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">value</td>
      <td data-ice="type" class="code"><span>any</span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>new value for given key</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-toJSON">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">toJSON</span><span class="code" data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4411">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Convert the instance to a JSON representation.
Proxies to calling <code>get</code> with no keys.
This means get all values gotten from the DB, and apply all custom getters.</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#instance-method-get">Model#get</a></span></span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-update">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">update</span><span class="code" data-ice="signature">(values: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4157">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>This is the same as calling <code>set</code> and then calling <code>save</code> but it only saves the
exact values passed to it, making it more atomic and safer.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">values</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>See <code>set</code></p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>See <code>save</code></p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="/v5/class/lib/model.js~Model.html">Model</a></span>&gt;</td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  <div data-ice="see"><h4>See:</h4><ul><li><span><span><a href="/v5/class/lib/model.js~Model.html#instance-method-set">Model#set</a></span></span></li>
<li><span><span><a href="/v5/class/lib/model.js~Model.html#instance-method-save">Model#save</a></span></span></li></ul></div>
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-validate">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">validate</span><span class="code" data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber4139">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Validate the attributes of this instance according to validation rules set in the model definition.</p>
<p>The promise fulfills if and only if validation successful; otherwise it rejects an Error instance containing { field name : [error msgs] } entries.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">options</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>Options that are passed to the validator</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.skip</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>An array of strings. All properties that are in this array will not be validated</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.fields</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>An array of strings. Only the properties that are in this array will be validated</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" class="code" data-depth="1">options.hooks</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: true</li></ul></td>
      <td data-ice="description"><p>Run before and after validate hooks</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="instance-method-where">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    
    <span class="code" data-ice="name">where</span><span class="code" data-ice="signature">(checkVersion: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="/v5/file/lib/model.js.html#lineNumber3443">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Get an object representing the query for this instance, use with <code>options.where</code></p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" class="code" data-depth="0">checkVersion</td>
      <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li>
<li>default: false</li></ul></td>
      <td data-ice="description"><p>include version attribute in where hash</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tbody>
        <tr>
          <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
          
        </tr>
      </tbody>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  

  
  
</div>
</div>
</div>

<footer class="footer">
  Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="/v5/./image/esdoc-logo-mini-black.png"></a>
</footer>

<script src="/v5/script/search_index.js"></script>
<script src="/v5/script/search.js"></script>
<script src="/v5/script/pretty-print.js"></script>
<script src="/v5/script/inherited-summary.js"></script>
<script src="/v5/script/test-summary.js"></script>
<script src="/v5/script/inner-link.js"></script>
<script src="/v5/script/patch-for-local.js"></script>


</body></html>